<?php 
class Tmenugrouprelation extends AppModel {


	var $name = 'Tmenugrouprelation';
	var $useTable = 'tmenu_group_relation';
	var $primaryKey = "id";
	/**
     * get menus for group
     *
     * @param int $gid groupid
     * @return array
     */
	function getGroupMenus($gid = NULL) {
		$result = array();
		if (NULL == $gid) {
			return $result;
		}
		$rs = $this->findAll("f_gid='$gid'");
		if (0 == count($rs)) {
			return $result;
		}
		foreach ($rs as $value) {
			$result[] = $value['Tmenugrouprelation']['f_mid'];
		}
		return $result;
	}

}
?>
